<meta charset="UTF-8">
  <div class="content-wrapper">
    <section class="content-header">
      <h1 style="text-align:center">
        	餐卡类型
      </h1>
    </section>
    <section class="content" style='position: relative;'> 
         <div class="panel-body" style="padding-bottom:0px;">
						<div class="row searchdiv">
							<div class="form-group col-lg-2 col-xs-6 space" style='display: inline-block;width: 160px;vertical-align: middle;position: relative;'>
										<input  class="form-control" type="text" placeholder="类型名称筛选" ng-model="cardInfor"  >
										<!--<span style='position: absolute;top: 0px;right: 0px;padding: 6px 10px;z-index: 10;' ng-click="clearSelectMealCard()">-->
											<!--<img src="../imgs/del.png" style='width: 15px;'/>-->
										<!--</span>-->
			     			 </div>
			     			 <input id='mealCard_no' style='display: none;' ng-model="busCol_cardNo">
							<!--<div class="form-group col-lg-2 col-xs-6 space" >
                    <button type="submit" class="btn btn-default" style='padding: 6px 12px;' ng-click='search()'>
                    	<i class="fa fa-search"> 查询</i>
                    </button>
                </div>-->
			     			 <button style='margin-right: 80px;' class="btn pull-right" ng-click="download('mealCardTable','餐卡类型')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>
			   					 <!--<div style='float: right;margin-right: 2%;height: 35px;line-height: 35px;background-color:#3c8dbc;color: #fff;font-size: 16px;
			   						cursor: pointer;width: 60px;text-align: center;border-radius: 3px;' ng-click='toPublish()'>
			   						保存
			   					</div>-->
						</div>
			   
			<!--表格-->
			<div class="box" style='width: calc( 100% - 65px );display: inline-block;'>
            <div class="box-body">
              <div  class="dataTables_wrapper form-inline dt-bootstrap"><div class="row"><div class="col-sm-6"></div><div class="col-sm-6"></div></div><div class="row"><div class="col-sm-12">
	              	<table id='mealCardTable' style='width: 100%; position: relative;overflow: auto;height:450px; display: block;background: #ffffff;'  class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
		                <thead style='display: inline-table;width: 100%;'>
			                <tr role="row">
			                	<th    style="width: 10%;">类型名称</th>
			                	<th  style="width: 10%;">月补金额</th>
			                	<th   style="width: 10%;">每日限额</th>
			                	<th  style="width: 10%;">透支额度</th>
			                	<th   style="width: 15%;">押金</th>
			                	<th   style="width: 15%;">是否为临时卡</th>
			                	<!--<th   style="width: 15%;">部门权限维护</th>-->
			                </tr>
		                </thead>
		              <tbody id='dataList' style='display: inline-table;width: 100%;'>
				                <tr ng-click="itemSelected($event)" style='position: relative;width: 100%;display: inline-table;' ng-class="{even:!$even, odd:!$odd}" ng-repeat="meal in mealCardInfors">
					                  <td style="width: 10%;display: none;">{{meal.id}}</td>	
					                  <td style="width: 10%;">{{meal.name}}</td>	
					                  <td style="width: 10%;" >{{meal.perMoneyMonth}}</td>
					                  <td style="width: 10%;">{{meal.useMoneyLimitDay}}</td>
					                  <td style="width: 10%;">{{meal.overDraftLine}}</td>
					                  <td style="width: 15%;">{{meal.deposit}}</td>
					                  <td style="width: 15%;">{{meal.isTemp == 1 ? '是' : '否'}}</td>
					                  <!--<td style="width: 15%;" >
					                  	<a href=""  class="btn btn-lg edit" style="padding:0px" title="修改" ng-click="edit(meal.cardKindId)">
					                  		<i class="fa fa-edit">
					                  		</i>
					                  	</a>
					                  </td>-->
				                </tr>
		                </tbody>
		                <tfoot>
		                </tfoot>
	              </table>
              </div>
              </div>
              <!--<div class="row" style="margin-bottom:10px;">
              	<div class="col-sm-3">
              		<div class="dataTables_info" id="example1_info" role="status" aria-live="polite">总条目数：{{totalNums}}</div>
              	</div>
                <div class="col-sm-9">
                	<div class="dataTables_paginate paging_simple_numbers row" id="example1_paginate">
                		<label style="font-weight:normal;float:left;padding-right:15px;">每页显示数目 
                			<select name="example1_length" aria-controls="example1" class="form-control input-sm" ng-change="change(initial)" ng-model="initial" > 
                				<option value="10">10</option> 
                				<option value="25">25</option>
                				<option value="50">50</option>
                				<option value="100">100</option>
                			</select>
                		</label>
                		<ul class="pagination col-lg-7" style='cursor: pointer;'>
                			<li class="paginate_button previous " id="example1_previous" >
                				<a  ng-click="Previous()">上一页</a>
                			</li>
                			<li   ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}">
                				<a  ng-click="selectPage(page)">{{page}}</a>
                			</li>
                			<li class="paginate_button next" id="example1_next">
                				<a  ng-click="Next()">下一页</a>
                			</li>
                		</ul>
                	</div>
                </div>
              </div>-->
              </div>
            </div>
      </div>
	        <div class="btn-group-vertical" style='position: absolute;margin: 1%;width: 65px;'>
		          <button type="button" class="btn btn-info" ng-click="openAddModal()">新增</button>
		          <button type="button" class="btn btn-info" ng-click="openupdateModal()">修改</button>
		          <!--<button type="button" class="btn btn-info" ng-click="delCardType()">删除</button>-->
	        </div>
	</section>
</div>

<!-- 关联部门modal -->
<div class="modal fade" id="relationDepartment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">部门关联</h4>
      </div>
      <div class="modal-body form-horizontal" style='height: 460px;display: flex;'>
      	<div style='width: 20%;height: 100%;display: inline-block;border: 1px solid #ccc;overflow: auto;'>
      			<div ng-class="{choiced:$index == 0}" ng-click='getDepartments($event,carteen.canteen_id)' style='width: 100%;text-align: center;line-height: 40px;height: 40px;border-bottom: 1px solid #ccc;'  ng-repeat="carteen in canteens">{{carteen.canteen_name}}</div>
      	</div>
        <div class="box-body" style='width: 70%;height: 100%;margin-left:8%;overflow: auto;'>
        	<!--<form class="form-horizontal">-->
                <!--<div class="box-body">-->
                    <table id='dishTable' style='width: 100%;position: relative; display: block;border: 1px solid #ccc;' id="example1" class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
			                <thead style='display: inline-table;width: 100%;background: #ffffff;'>
				                <tr role="row">
				                	<th    style="width: 5%;">选择</th>
				                	<th    style="width: 12%;">部门名称</th>
				                </tr>
			                </thead>
			              <tbody id='dataList' style='display: inline-table;width: 100%;'>
					                <tr  style='position: relative;width: 100%;display: inline-table;' ng-class="{even:!$even, odd:!$odd}" ng-repeat="dept in depts">
						                  <td style="width: 5%;">
						                  	<!--{{dish.id}}-->
						                  	<input type="checkbox" name='id' value='{{dept.id}}'	ng-model='dept.is_checked' />
						                  </td><!--菜品id-->
						                  <td style="width: 12%;">{{dept.name}}</td>
					                </tr>
			                </tbody>
		                <tfoot>
		                </tfoot>
	             	  </table>
	             	  
	             	  
	             	  
                <!--</div>-->
                <!--</form>-->
	    </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-success btn-lg" ng-click="relationDept_true()">确定</button>
      </div>
    </div>
  </div>
</div>  

<!-- 新增卡类型modal --> 
	<div class="modal fade" id="addCardType" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">卡类型新增</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body" >
        	<form class="form-horizontal">
                <div class="box-body">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">类型名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" ng-model="cardTypeName" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">月补金额</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6"  required  class="form-control" ng-model="perMoneyMonth" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">每日限额</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6" required  class="form-control" ng-model="useMoneyLimitDay" ><!--readonly-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">透支额度</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6" required  class="form-control" ng-model="overDraftLine" ><!--readonly-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">押金</label>
                        <div class="col-sm-10">
                           <input type="number"  maxlength="6" required  class="form-control" ng-model="deposit" >
                        </div>
                    </div>
                    <div class='row1'>
				    					<label style='flex: 0 0 125px;float: left;'>是否为临时卡</label>
				    					 <div class="col-sm-9">
				                            <input class='tgl tgl-flat' id='isTemp' type='checkbox' ng-model="isTemp">
				    													<label class='tgl-btn' for='isTemp'></label>
				                        </div>
				    				</div>
                </div>
                
                </form>
	    </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-success btn-lg" ng-click="addType_true()">确定</button>
      </div>
    </div>
  </div>
</div>

<!-- 卡类型维护modal --> 
	<div class="modal fade" id="updateCardType" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" style="text-align:center">卡类型维护</h4>
      </div>
      <div class="modal-body form-horizontal">
        <div class="box-body" >
        	<form class="form-horizontal">
                <div class="box-body">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">类型名称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" ng-model="cardTypeName" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">月补金额</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6" class="form-control" ng-model="perMoneyMonth" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">每日限额</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6" class="form-control" ng-model="useMoneyLimitDay" ><!--readonly-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">透支额度</label>
                        <div class="col-sm-10">
                            <input type="number" maxlength="6" class="form-control" ng-model="overDraftLine" ><!--readonly-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">押金</label>
                        <div class="col-sm-10">
                           <input type="number"  maxlength="6" class="form-control" ng-model="deposit" >
                        </div>
                    </div>
                    <div class='row1'>
				    					<label style='flex: 0 0 125px;float: left;'>是否为临时卡</label>
				    					 <div class="col-sm-9">
				                            <input class='tgl tgl-flat' id='isTemp' type='checkbox' ng-model="isTemp">
				    													<label class='tgl-btn' for='isTemp'></label>
				                        </div>
				    				</div>
                </div>
                
                </form>
	    </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default btn-lg pull-left" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-success btn-lg" ng-click="updateType_true()">确定</button>
      </div>
    </div>
  </div>
</div>

<style>
	.space{padding-left:2px;padding-right:2px;	}
	.box{border-top:1px solid #d2d6de;}
	.pagination{margin:0;}
	.odd{background-color: #f9f9f9 ;}
	.even{background-color: transparent ;}
	.btn{padding: 10px 12px;}
	.choiced{background-color:#e4eaec;}
</style>
